<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>const 关键字</title>
</head>

<!-- const 用于声明一个或多个常量，声明时必须进行初始化，且初始化后值不可再修改 -->

<body>
    <h2>JavaScript const</h2>

    <p>const 用于声明一个或多个常量，声明时必须进行初始化，且初始化后值不可再修改。</p>

    <p id="demo"></p>

    <script>
        try {
            const PI = 3.141592653589793;
            PI = 3.14;
        }
        catch (err) {
            document.getElementById("demo").innerHTML = err;
        }
    </script>
</body>

</html>